<?php

namespace Platform\Services\SysConfig;

use Platform\Libs\AliOssManage;
use Platform\Services\BaseService;

class SysConfigService extends BaseService {

    public function getOssSignActionByType($type) {
        $aliOssManage = new AliOssManage();
        switch ($type) {
            case "1":
                $result = $aliOssManage->getSign($aliOssManage::REDPACKET_VIDEO_DIR, $aliOssManage::DEFAULT_SIGN_EXPIRE_TIME, $aliOssManage::REDPACKET_BUCKET, $aliOssManage::HANGZHOU_HOSTNAME);
                $result['domain'] = OSS_RED_PACKET;
                $result['host'] = OSS_RED_PACKET;
                break;
            case "2":
                $result = $aliOssManage->getSign($aliOssManage::ADMIN_IMG_DIR, $aliOssManage::DEFAULT_SIGN_EXPIRE_TIME, $aliOssManage::REDPACKET_BUCKET, $aliOssManage::HANGZHOU_HOSTNAME);
                $result['domain'] = OSS_RED_PACKET;
                $result['host'] = OSS_RED_PACKET;
                break;
            case "3":
                $result = $aliOssManage->getSign($aliOssManage::MATERIAL_IMG_DIR, $aliOssManage::DEFAULT_SIGN_EXPIRE_TIME, $aliOssManage::REDPACKET_BUCKET, $aliOssManage::HANGZHOU_HOSTNAME);
                $result['domain'] = OSS_RED_PACKET;
                $result['host'] = OSS_RED_PACKET;
                break;
            case "4":
                $result = $aliOssManage->getSign($aliOssManage::MATERIAL_VIDEO_DIR, $aliOssManage::DEFAULT_SIGN_EXPIRE_TIME, $aliOssManage::REDPACKET_BUCKET, $aliOssManage::HANGZHOU_HOSTNAME);
                $result['domain'] = OSS_RED_PACKET;
                $result['host'] = OSS_RED_PACKET;
                break;
            case "5":
                $result = $aliOssManage->getSign($aliOssManage::MATERIAL_MUSIC_DIR, $aliOssManage::DEFAULT_SIGN_EXPIRE_TIME, $aliOssManage::REDPACKET_BUCKET, $aliOssManage::HANGZHOU_HOSTNAME);
                $result['domain'] = OSS_RED_PACKET;
                $result['host'] = OSS_RED_PACKET;
                break;
            default:
                $result = $aliOssManage->getSign($aliOssManage::REDPACKET_VIDEO_DIR, $aliOssManage::DEFAULT_SIGN_EXPIRE_TIME, $aliOssManage::REDPACKET_BUCKET, $aliOssManage::HANGZHOU_HOSTNAME);
                $result['domain'] = OSS_RED_PACKET;
                $result['host'] = OSS_RED_PACKET;
        }
        return $result;
    }

}

?>
